﻿<wpfui:UiWindow
    x:Class="LenovoLegionToolkit.WPF.Windows.Utils.StatusWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:resources="clr-namespace:LenovoLegionToolkit.WPF.Resources"
    xmlns:system="clr-namespace:System;assembly=System.Runtime"
    xmlns:utils="clr-namespace:LenovoLegionToolkit.WPF.Utils"
    xmlns:wpfui="http://schemas.lepo.co/wpfui/2022/xaml"
    Width="300"
    Height="100"
    MinWidth="300"
    MinHeight="100"
    FlowDirection="{x:Static utils:LocalizationHelper.Direction}"
    mc:Ignorable="d">
    <wpfui:UiWindow.Resources>
        <system:Double x:Key="SymbolFontSize">24</system:Double>
        <system:Double x:Key="PrimaryFontSize">14</system:Double>
        <system:Double x:Key="SecondaryFontSize">14</system:Double>
        <system:Double x:Key="TertiaryFontSize">12</system:Double>
    </wpfui:UiWindow.Resources>

    <StackPanel Background="{DynamicResource SystemFillColorSolidNeutralBackgroundBrush}">
        <TextBlock
            x:Name="_title"
            Margin="16,16,16,0"
            FontSize="{StaticResource TertiaryFontSize}"
            Foreground="{DynamicResource TextFillColorTertiaryBrush}"
            Text="{x:Static resources:Resource.AppName}" />

        <Grid Margin="16,16,16,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <wpfui:SymbolIcon
                Grid.Column="0"
                FontSize="{StaticResource SymbolFontSize}"
                Symbol="Gauge24" />
            <Label
                Grid.Row="0"
                Grid.Column="1"
                Margin="8,0,0,0"
                VerticalContentAlignment="Center"
                Content="{x:Static resources:Resource.StatusTrayPopup_PowerMode}"
                FontSize="{StaticResource PrimaryFontSize}"
                FontWeight="Medium"
                Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
            <StackPanel
                Grid.Row="0"
                Grid.Column="3"
                Margin="16,0,0,0"
                HorizontalAlignment="Right"
                VerticalAlignment="Center"
                Orientation="Horizontal">
                <Ellipse
                    x:Name="_powerModeValueIndicator"
                    Width="12"
                    Height="12"
                    Margin="0,0,0,2" />
                <Label
                    x:Name="_powerModeValueLabel"
                    Margin="8,0,0,0"
                    VerticalContentAlignment="Center"
                    FontSize="{StaticResource PrimaryFontSize}"
                    Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
            </StackPanel>

            <Label
                x:Name="_powerModePresetLabel"
                Grid.Row="1"
                Grid.Column="1"
                Margin="8,4,0,0"
                VerticalContentAlignment="Center"
                Content="{x:Static resources:Resource.StatusTrayPopup_Preset}"
                FontSize="{StaticResource SecondaryFontSize}"
                FontWeight="Medium"
                Foreground="{DynamicResource TextFillColorSecondaryBrush}"
                Visibility="Collapsed" />
            <Label
                x:Name="_powerModePresetValueLabel"
                Grid.Row="1"
                Grid.Column="3"
                Margin="16,4,0,0"
                HorizontalAlignment="Right"
                FontSize="{StaticResource SecondaryFontSize}"
                Foreground="{DynamicResource TextFillColorSecondaryBrush}"
                Visibility="Collapsed" />
        </Grid>

        <Grid x:Name="_gpuGrid" Margin="16,16,16,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <wpfui:SymbolIcon
                Grid.Row="0"
                Grid.Column="0"
                FontSize="{StaticResource SymbolFontSize}"
                Symbol="DeveloperBoard24" />
            <Label
                Grid.Row="0"
                Grid.Column="1"
                Margin="8,0,0,0"
                VerticalContentAlignment="Center"
                Content="{x:Static resources:Resource.StatusTrayPopup_DiscreteGPU}"
                FontSize="{StaticResource PrimaryFontSize}"
                FontWeight="Medium"
                Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
            <StackPanel
                x:Name="_gpuActive"
                Grid.Row="0"
                Grid.Column="3"
                Margin="16,0,0,0"
                HorizontalAlignment="Right"
                VerticalAlignment="Center"
                Orientation="Horizontal"
                Visibility="Collapsed">
                <Ellipse
                    Width="12"
                    Height="12"
                    Margin="0,0,0,2"
                    Fill="#FF8BC34A" />
                <Label
                    Margin="8,0,0,0"
                    VerticalContentAlignment="Center"
                    Content="{x:Static resources:Resource.Active}"
                    FontSize="{StaticResource PrimaryFontSize}"
                    Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
            </StackPanel>
            <StackPanel
                x:Name="_gpuInactive"
                Grid.Row="0"
                Grid.Column="3"
                Margin="16,0,0,0"
                HorizontalAlignment="Right"
                VerticalAlignment="Center"
                Orientation="Horizontal"
                Visibility="Collapsed">
                <Ellipse
                    Width="12"
                    Height="12"
                    Margin="0,0,0,2"
                    Fill="#F2A541" />
                <Label
                    Margin="8,0,0,0"
                    VerticalContentAlignment="Center"
                    Content="{x:Static resources:Resource.Inactive}"
                    FontSize="{StaticResource PrimaryFontSize}"
                    Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
            </StackPanel>
            <StackPanel
                x:Name="_gpuPoweredOff"
                Grid.Row="0"
                Grid.Column="3"
                Margin="16,0,0,0"
                HorizontalAlignment="Right"
                VerticalAlignment="Center"
                Orientation="Horizontal"
                Visibility="Collapsed">
                <Ellipse
                    Width="12"
                    Height="12"
                    Margin="0,0,0,2"
                    Fill="#BF360C" />
                <Label
                    Margin="8,0,0,0"
                    VerticalContentAlignment="Center"
                    Content="{x:Static resources:Resource.PoweredOff}"
                    FontSize="{StaticResource PrimaryFontSize}"
                    Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
            </StackPanel>

            <Label
                x:Name="_gpuPowerStateValue"
                Grid.Row="1"
                Grid.Column="1"
                Margin="8,4,0,0"
                VerticalContentAlignment="Center"
                Content="{x:Static resources:Resource.StatusTrayPopup_PowerState}"
                FontSize="{StaticResource SecondaryFontSize}"
                FontWeight="Medium"
                Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
            <Label
                x:Name="_gpuPowerStateValueLabel"
                Grid.Row="1"
                Grid.Column="3"
                Margin="16,4,0,0"
                HorizontalAlignment="Right"
                FontSize="{StaticResource SecondaryFontSize}"
                Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
        </Grid>

        <Grid Margin="16,16,16,16">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <wpfui:SymbolIcon
                x:Name="_batteryIcon"
                Grid.Row="0"
                Grid.Column="0"
                FontSize="{StaticResource SymbolFontSize}"
                Symbol="Battery624" />
            <Label
                Grid.Row="0"
                Grid.Column="1"
                Margin="8,0,0,0"
                VerticalContentAlignment="Center"
                Content="{x:Static resources:Resource.StatusTrayPopup_Battery}"
                FontSize="{StaticResource PrimaryFontSize}"
                FontWeight="Medium"
                Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
            <Label
                x:Name="_batteryValueLabel"
                Grid.Row="0"
                Grid.Column="3"
                Margin="16,0,0,0"
                HorizontalAlignment="Right"
                VerticalContentAlignment="Center"
                FlowDirection="LeftToRight"
                FontSize="{StaticResource PrimaryFontSize}"
                Foreground="{DynamicResource TextFillColorPrimaryBrush}" />

            <Label
                Grid.Row="1"
                Grid.Column="1"
                Margin="8,4,0,0"
                VerticalContentAlignment="Center"
                Content="{x:Static resources:Resource.StatusTrayPopup_Mode}"
                FontSize="{StaticResource SecondaryFontSize}"
                FontWeight="Medium"
                Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
            <Label
                x:Name="_batteryModeValueLabel"
                Grid.Row="1"
                Grid.Column="3"
                Margin="16,4,0,0"
                HorizontalAlignment="Right"
                FontSize="{StaticResource SecondaryFontSize}"
                Foreground="{DynamicResource TextFillColorSecondaryBrush}" />

            <Label
                Grid.Row="2"
                Grid.Column="1"
                Margin="8,4,0,0"
                VerticalContentAlignment="Center"
                Content="{x:Static resources:Resource.StatusTrayPopup_DischargeRate}"
                FontSize="{StaticResource SecondaryFontSize}"
                FontWeight="Medium"
                Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
            <Label
                x:Name="_batteryDischargeValueLabel"
                Grid.Row="2"
                Grid.Column="3"
                Margin="16,4,0,0"
                HorizontalAlignment="Right"
                FlowDirection="LeftToRight"
                FontSize="{StaticResource SecondaryFontSize}"
                Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
        </Grid>

        <Border
            x:Name="_updateIndicator"
            Padding="8,4,8,4"
            Background="{DynamicResource SystemFillColorSuccessBrush}"
            CornerRadius="0,0,8,8"
            Visibility="Collapsed">
            <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
                <wpfui:SymbolIcon
                    Margin="0,0,4,0"
                    FontSize="{StaticResource PrimaryFontSize}"
                    Foreground="{DynamicResource TextFillColorPrimaryBrush}"
                    Symbol="ArrowSync24" />
                <TextBlock
                    FontSize="{StaticResource SecondaryFontSize}"
                    Foreground="{DynamicResource TextFillColorPrimaryBrush}"
                    Text="{x:Static resources:Resource.StatusTrayPopup_UpdateAvailable}" />
            </StackPanel>
        </Border>

    </StackPanel>
</wpfui:UiWindow>
